﻿/* --------------------------------------------
 * 通用的上传
 ----------------------------------------------*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FL.Common;
using System.IO;
using FL.DataImport;
using System.Data;

namespace FL.Web.BackEnd
{
    public partial class ImportPage : FL.Web.BackEnd.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string tableName = GetStringFromQueryString("entity", "");     //要保存的表
            string filePath = GetStringFromQueryString("file", "");        //保存的对应的文件
        }

        /// <summary>
        /// 数据导入 
        /// </summary>
        /// <param name="tableName"></param>
        /// <param name="filePath"></param>
        private void Import(string tableName,string filePath)
        {
            DataImport.DataImportBase import = new DataImportBase();
            DataTable dt = import.GetExeclTable(Server.MapPath(filePath));
            try
            {
                import.Import(dt, tableName);
            }
            catch (Exception)
            {

            }
        }
    }
}